package com.dunqi.gpm.shunqing.home.adapter;

import com.chad.library.adapter.base.BaseViewHolder;
import com.dunqi.gpm.shunqing.R;
import com.dunqi.gpm.shunqing.common.base.RecyclerAdapter;
import com.dunqi.gpm.shunqing.common.util.Arith;
import com.dunqi.gpm.shunqing.home.bean.Project;

import java.util.ArrayList;

/**
 * Created by Administrator on 2017/12/3.
 */

public class PlanAuditAdapter extends RecyclerAdapter<Project> {

    private final String[] constructionTypes;
    private final String[] constructionTypeTexts;
    private final String[] status = {"待提交", "待审核", "审核通过", "审核未通过", "待结项", "已结项"};

    public PlanAuditAdapter(ArrayList<Project> data) {
        super(R.layout.item_plan_audit, data);

        constructionTypes = new String[]{"new", "modify", "continue", "extend", "modify_extend", "migration",
                "upgrade"};
        constructionTypeTexts = new String[]{"新建", "改建", "续建", "扩建", "改扩建", "迁建",
                "改造和技术改造"};

    }

    @Override
    protected void convert(BaseViewHolder helper, Project item) {
        helper.setText(R.id.title_tv, helper.getAdapterPosition() + 1 + "." + item.getProjectName())
                .setText(R.id.plan_year_tv, item.getPlanYear() + "年")
                .setText(R.id.money_tv, Arith.get2Double(item.getTotalInvestmentAmount()) + "万元")
                .setText(R.id.state_tv, status[item.getAuditStatus()]);

    }
}
